/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package wordreverse;

import javax.swing.JOptionPane;

/**
 *
 * @author Wyatt
 */
public class WordReverse {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        int length = 0;
        char holder = 0;
        String reverse = "";
        String input = JOptionPane.showInputDialog("Enter a word to reverse");
        
        length = input.length();
        
        for (int i = 0; i < length; i++) {
            reverse = input.charAt(i) + reverse;
            
        }
        
        JOptionPane.showMessageDialog(null, reverse);
    }
}
